<!-- 设备管理-设备档案-设备类型 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="类型名称">
              <el-input v-model="listQuery.fcatno" placeholder="类型名称" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="设备类别">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <!-- <el-button type="success" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button> -->
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FCATNO" label="类别编号" width="75"></el-table-column>
          <el-table-column prop="FCATNAME" label="类别名称" width="125"></el-table-column>
          <el-table-column prop="FREDCODE" label="红外码库" width="125"></el-table-column>
          <el-table-column prop="FNUM" label="编码" width="75"></el-table-column>
          <el-table-column prop="FMEMO" label="备注" ></el-table-column>
          <el-table-column fixed="left" label="操作" align="center" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        //所属校区选择数据
        options1: [{
          value: '10',
          label: '排插'
        }, {
          value: '20',
          label: '环境设备'
        }, {
          value: '30',
          label: '节能设备'
        }],

        customlist:[
          {
            "FCATNO": "5",
            "FCATNAME": "空调",
            "FREDCODE": "view_arc_brand",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FNOTE":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
          },
        ],
        list: [
            {
            "FCATNO": "1",
            "FCATNAME": "单插",
            "FREDCODE": "",
            "FNUM": "D",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "2",
            "FCATNAME": "双开",
            "FREDCODE": "",
            "FNUM": "S",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },
            ,{
            "FCATNO": "3",
            "FCATNAME": "灯",
            "FREDCODE": "",
            "FNUM": "T",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "5",
            "FCATNAME": "空调",
            "FREDCODE": "view_arc_brand",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "6",
            "FCATNAME": "高速离心机",
            "FREDCODE": "view_arc_brand",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "7",
            "FCATNAME": "加热仪器设备",
            "FREDCODE": "view_arc_brand",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FMEMO":"明火电炉，电阻炉，恒温箱，干燥箱，电热枪，电吹风，水浴锅，旋转蒸发仪",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "8",
            "FCATNAME": "通风柜",
            "FREDCODE": "view_arc_air",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },{
            "FCATNO": "9",
            "FCATNAME": "生物安全柜",
            "FREDCODE": "",
            "FNUM": "K",
            "FSHEETNO": "1",
            "FMEMO":"",
            "FOPERATOR": "system",
            "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>